#include "bsp_callback.h"

extern osSemaphoreId_t uwb_transfer_handler;




uint8_t uwb_rcv_res=0;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
	if(GPIO_Pin == DECAIRQ)
	{
		/*UWB IRQ*/
		uint32_t mask;
		mask = dwt_read32bitreg(SYS_STATUS_ID) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_ERR) ;
		if(mask & SYS_STATUS_RXFCG)
		{
			uwb_rcv_res=0;
		}
		else
		{
			uwb_rcv_res=1;
		}
		dwt_write32bitreg(SYS_STATUS_ID, mask);		
		osSemaphoreRelease(uwb_transfer_handler);
	}
}




